package com.own.business.resource.core.config;

import com.own.business.resource.core.method.SignatureBusinessMethod;
import com.own.business.resource.core.property.ResourceProperty;
import org.springframework.boot.SpringBootConfiguration;
import org.springframework.boot.autoconfigure.condition.ConditionalOnMissingBean;
import org.springframework.context.annotation.Bean;

import javax.annotation.Resource;

/**
 * ResourceCoreAutoConfig
 *
 * @author chenxueli
 * @date 2024-01-02 14:30:00
 */
@SpringBootConfiguration
public class ResourceCoreAutoConfig {

    @Resource
    private ResourceProperty resourceProperty;

    @Bean
    @ConditionalOnMissingBean(SignatureBusinessMethod.class)
    public SignatureBusinessMethod signatureBusinessMethod() {
        return (module, sign) -> resourceProperty.getPrimary();
    }

}
